public class Simulator {
	public static void main(String argv[])
	{
		try {
			//ClassLoader scl = ClassLoader.getSystemClassLoader();

			/* Preload ArduinoCore */
			//ClassLoader.getSystemClassLoader().loadClass("ArduinoCore");

			SketchClassLoader cl = new SketchClassLoader();
			Class c = cl.loadClass(argv[0]);
			System.out.println("Loaded "+c.getName());
			Object o = c.newInstance();
			new Thread((net.grapsus.arduino.ArduinoCore)o).start();
			//((ArduinoCore)o).run();
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.out.println("Done\n");
	}

	/*
	class Launch implements Runnable {
		ArduinoCore c;
		Launch(ArduinoCore c)
		{
			this.c = c;
		}
		public void run()
		{
			c.setup();
			while(true)
				c.loop();
		}
	}
	*/
}
